var IHTMLURL = HTMLURL + "/index";
var IJSURL = JSURL + '/index';
var ICSSURL = CSSURL + '/index';
var IJSONURL = JSONURL + '/index';

(function(){
    DD.createModule(
        [
            {
                name: "find",
                templateUrl: IHTMLURL + "/find.html",
                dataUrl: IJSONURL + "/find.json",
                delayInit: true,
                methods:{
                    goback:function(){
                        window.history.back(-1);
                    }
                },
                requires: [{type:'css',path:ICSSURL + '/find.css'},IJSURL+'/find.js']
            },{
            name: "home",
            templateUrl: IHTMLURL + "/home.html",
            dataUrl: IJSONURL + "/home.json",
            delayInit: true,
            requires: [{type:'css',path:ICSSURL + '/home.css'}]
        },{
            name: "order",
            // templateUrl: IHTMLURL + "/find.html",
            // dataUrl: IJSONURL + "/find.json",
            delayInit: true
            // requires: [{type:'css',path:ICSSURL + '/find.css'},IJSURL+'/find.js']
        },{
            name: "mine",
            templateUrl: IHTMLURL + "/mine.html",
            dataUrl: IJSONURL + "/mine.json",
            delayInit: true,
            requires: [{type:'css',path:ICSSURL + '/mine.css'},IJSURL+'/mine.js']
        },{
            name: "command",
            templateUrl: IHTMLURL + "/command.html",
            dataUrl: IJSONURL + "/command.json",
            delayInit: true,
            requires: [{type:'css',path:ICSSURL + '/command.css'},IJSURL+'/command.js']
        },{
            name: "creditcard",
            templateUrl: IHTMLURL + "/creditcard.html",
            dataUrl: IJSONURL + "/creditcard.json",
            delayInit: true,
            requires: [{type:'css',path:ICSSURL + '/creditcard.css'},IJSURL+'/creditcard.js']
        },{
            name: "prod"
            // templateUrl: IHTMLURL + "/mine.html",
            // dataUrl: IJSONURL + "/mine.json",
            // delayInit: true,
            // requires: [{type:'css',path:ICSSURL + '/mine.css'},IJSURL+'/mine.js']
        }
        ]
    );
}());


function setFontSize() {
        var width = window.innerWidth;
        if (width > 600) {
            width = 600;
        }
        // 得到默认fontsize
        var doc = DD.get('html');
        var fontSize = parseFloat(DD.css(doc, 'fontSize')) || 16;
        var x = width * 16 / (20 * fontSize);
        doc.style.fontSize = x + "px";

    }
    
window.onresize=function(){
    setFontSize();
}

